bitkeeper revision 1.1159.187.57 (41b5eb65x_JxVnjR7uA3FzGZDy11Hw)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 7 Dec 2004 17:41:57 +0000 (17:41 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 7 Dec 2004 17:41:57 +0000 (17:41 +0000)
xend fixes.

tools/python/xen/xend/encode.py
tools/python/xen/xend/sxp.py

index 38c9351db739e84146adcb2ad0a471e23e605531..48815defa9c21fdbfa11aec1391d8ceaa59e8f2b 100644 (file)
@@ -14,6 +14,8 @@ import httplib
 import random
 import md5
 
+from xen.util.ip import _readline, _readlines
+
 # Extract from HTML4 spec.
 ## The following example illustrates "multipart/form-data"
 ## encoding. Suppose we have the following form:
@@ -122,7 +124,7 @@ def encode_multipart(d):
             out.write('"\r\n')
             out.write('Content-Type: application/octet-stream\r\n')
             out.write('\r\n')
-            for l in v.readlines():
+            for l in _readlines(v):
                out.write(l)  
         else:
             out.write('Content-Disposition: form-data; name="')
index 98cc30341656f33fc85fc5d1cb5758d21f52e9df..35b24aa8aa266e399c9e96d4b771af0cd9424650 100644 (file)
@@ -17,6 +17,7 @@ import types
 import errno
 import string
 from StringIO import StringIO
+from xen.util.ip import _readline, _readlines
 
 __all__ = [
     "mime_type", 
@@ -713,7 +714,7 @@ def parse(io):
     """
     pin = Parser()
     while 1:
-        buf = io.readline()
+        buf = _readline(io)
         pin.input(buf)
         if len(buf) == 0:
             break